# -- coding: utf-8 --
# @Time : 2024/1/12 22:31
# @Author : rlh
# @File : exts.py
# 功能描述:  存放公共的变量

# 系统第三方库
from flask import Flask
import config

# 导入项目模块
from flask_cors import CORS



def create_app():
    app = Flask(__name__)
    CORS(app)
    app.config.from_object(config.env)

    # 注册蓝图
    # 导入蓝图包
    from Module_Blueprint.API_Module import API_BluePrint
    from Module_Blueprint import regist_centre
    from Module_Blueprint.Tools_Templates import Tools_BluePrint
    from Module_Blueprint.regist_centre.regist_index import index_bp
    # 注册蓝图
    app.register_blueprint(API_BluePrint.API_BluePrint)
    app.register_blueprint(regist_centre.HTML_Module_bp)
    app.register_blueprint(Tools_BluePrint.Tools_bp)
    app.register_blueprint(index_bp)



    return app



